work on #3727: limit the number of waypoints that can be loaded

Limit the number of waypoints that can be loaded from the database to
two times the number of caches under which the waypoints are not
shown anymore.