Optimal disturbances in three-dimensional boundary-layer flows