Fix leaking connection when 'Return bounding box' is selected for WFS service

Backport of #593