Mk/bsd.java.mk: Fix JAVA_VERSION matching
Anchor the matched patterns to be at the beginning of each word to
prevent unexpected surprises
e.g. with JAVA_VERSION= 17+ it results in _JAVA_VERSION set to
unexpected "17 8 11 12 13 14 15 16 17 18", instead of "17 18"
PR: 263483
Reported by: jrm
Reviewed by: glewis
Approved by: glewis