database: Add function to align to page boundaries