Work around MySQL library limitations

Tried using fetchone with limit=1 but it still crashes if for some
reason there is more than one result