fix for the failures under safari/webkit

described in https://github.com/openstreetmap/iD/issues/2388