ext2fs: Fix a bug when sorting htree entries.

This a typo introduced when bringing the original code from NetBSD.

Reported by:	Mike Ma
MFC after:	3 days
When calculating the MPU freq, make sure not to overflow by using a uint64_t.

PR:	arm/187223
Submitted by:	Svatopluk Kraus <onwahe@gmail.com>