Thanks to exceptional loans, an innovative and thought-provoking exhibition at the museum explores how slumber has inspired painters.