People with medical conditions waited months for driving licences during the pandemic, MPs say.