Fix traceback in mount.mounted state

This fixes a traceback introduced in 0c9bcab3.

Fixes #6522.