BUILD: fix Makefile.bsd

I just tried to build haproxy-1.4.25 on OpenBSD 5.5-current i386.

The build uses Makefile.bsd which tries to resolve VERSION, SUBVERS
and VERDATE from file (fallback w/o git).

Starting with haproxy-1.4.25, VERDATE and SUBVERS are two-liners :

cat /usr/ports/pobj/haproxy-1.4.25/haproxy-1.4.25/VERDATE
$Format:%ci$
2014/03/27

grep -E cat /usr/ports/pobj/haproxy-1.4.25/haproxy-1.4.25/Makefile.bsd
VERSION != cat VERSION 2>/dev/null || touch VERSION
SUBVERS != cat SUBVERS 2>/dev/null || touch SUBVERS
VERDATE != cat VERDATE 2>/dev/null || touch VERDATE

Because of the two lines in VERDATE and SUBVERS, you cant use cat
to get the intended values.

See what Makefile.bsd resolved for VERSION, SUBVERS and VERDATE

 > -DCONFIG_HAPROXY_VERSION=\"1.4.25-ormat:%h\"
 > -DCONFIG_HAPROXY_DATE=\"ormat:%ci2014/03/27\" -DTPROXY

Both defines go directly in printf's!

 > src/haproxy.c: In function 'display_version':
 > src/haproxy.c:161: warning: unknown conversion type character 0x20 in
format
 > src/haproxy.c:161: warning: too few arguments for format

 > src/dumpstats.c: In function 'stats_dump_raw_to_buffer':
 > src/dumpstats.c:928: warning: unknown conversion type character 0xa
in format
 > src/dumpstats.c:928: warning: format '%d' expects type 'int', but
argument 21 has type 'char *'
 > src/dumpstats.c:928: warning: too few arguments for format

I picked the relevant changes from haproxy's generic Makefile.
Essentially SUBVERS and VERDATE have to be replaced as follows

-SUBVERS != cat SUBVERS 2>/dev/null || touch SUBVERS
-VERDATE != cat VERDATE 2>/dev/null || touch VERDATE
+SUBVERS != ((grep -v "\$Format" SUBVERS 2>/dev/null || touch SUBVERS) |
head -n 1)
+VERDATE != ((grep -v "\$Format" VERDATE 2>/dev/null || touch VERDATE) |
head -n 1 | cut -f1 -d' ' | tr '-' '/')

to compile without warning.
BUILD: also fix Makefile.osx

Same patch as previously, for sure Makefile.osx needs the same fix.