WICKET-5673 Improve BookmarkableMapper and BasicResourceReferenceMapper to not match when the last segment is empty