xAdded lock around the use of OnuOmciStateMap to prevent a concurrent map write issue.

I considered using a structure like sync.Map or other concurrency safe map, but those don't offer type safety like the built in map object.

Added some missing licensing and a VERSION file as Jenkins is requiring it.

Change-Id: I755709ab4678da12c7585824074a1877f98a5ea1
diff --git a/omci_state.go b/omci_state.go
index 34d5b5e..eb923ba 100644
--- a/omci_state.go
+++ b/omci_state.go
@@ -18,6 +18,7 @@
 import (
 	"errors"
 	"fmt"
+	"sync"
 	log "github.com/sirupsen/logrus"
 )
 
@@ -43,6 +44,7 @@
 )
 
 var OnuOmciStateMap = map[OnuKey]*OnuOmciState{}
+var OnuOmciStateMapLock = sync.RWMutex{}
 
 func NewOnuOmciState() *OnuOmciState {
 	return &OnuOmciState{gemPortId: 0, mibUploadCtr: 0, uniGInstance: 1, tcontInstance: 0, pptpInstance: 1}
@@ -60,6 +62,8 @@
 }
 func GetOnuOmciState(intfId uint32, onuId uint32) istate {
 	key := OnuKey{intfId, onuId}
+	OnuOmciStateMapLock.RLock()
+	defer OnuOmciStateMapLock.RUnlock()
 	if onu, ok := OnuOmciStateMap[key]; ok {
 		return onu.state
 	} else {
@@ -69,6 +73,8 @@
 
 func GetGemPortId(intfId uint32, onuId uint32) (uint16, error) {
 	key := OnuKey{intfId, onuId}
+	OnuOmciStateMapLock.RLock()
+	defer OnuOmciStateMapLock.RUnlock()
 	if OnuOmciState, ok := OnuOmciStateMap[key]; ok {
 		if OnuOmciState.state != DONE {
 			errmsg := fmt.Sprintf("ONU {intfid:%d, onuid:%d} - Not DONE (GemportID is not set)", intfId, onuId)