[convert.c] Return -1 if flag conversion fails

Change-Id: I7b5724b67484d31d044dec5d15377a13a1276315
Reviewed-on: http://review.couchbase.org/27621
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>